package com.ymdx.entity;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.Date;

/**
 * 用户实体类
 * Created by yangliwei on 2017/8/13.
 */
@Entity
@Table(name = "user", uniqueConstraints = {@UniqueConstraint(columnNames = "mobile")})
public class User extends IdEntity {
    private String mobile;//手机号
    private String password;//密码
    private String nickName;//用户名
    private String header;//头像
    private String gender;//性别
    private String email;//邮箱
    private Date loginDate;//登录时间
    private String qq;//qq
    private String weixin;//微信
    private String parentMobile;//家长手机号
    private String studentId;//学员号

//    private Set<Product> product;//作品

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getWeixin() {
        return weixin;
    }

    public void setWeixin(String weixin) {
        this.weixin = weixin;
    }


    public String getParentMobile() {
        return parentMobile;
    }

    public void setParentMobile(String parentMobile) {
        this.parentMobile = parentMobile;
    }

    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

//  这里不用一对多了，因为前台分开查询了
//    @OneToMany(fetch = FetchType.EAGER)
//    @JoinColumn(name = "productid")
//    public Set<Product> getProduct() {
//        return product;
//    }
//
//    public void setProduct(Set<Product> product) {
//        this.product = product;
//    }
}
